package com.chexiang360.ex;

import com.chexiang360.dto.Result;

public class ServiceException extends Exception {
	private static final long serialVersionUID = -2879009315337384347L;

	private Result<String> result;

	public ServiceException() {
	}

	public Result<String> getResult() {
		return result;
	}

	public void setResult(Result<String> result) {
		this.result = result;
	}

	/**
	 * 构造一个含有result信息的异常(提示)信息
	 * 
	 * @param result
	 */
	public ServiceException(Result<String> result) {
		super(result.getMsg());
		this.result = result;
	}

	public ServiceException(String msg) {
		this.result = Result.initFailureResult(Result.ERROR_CORD, msg);
	}
	
	public ServiceException(int code , String msg) {
		this.result = Result.initFailureResult(code, msg);
	}
}